import axios, {ResultData} from './';
export namespace Register {
    // 用户注册表单
    export interface RegisterReqForm {
        username: string,
        name?:string,//可不填
        password:string
    }
    // 登录成功后返回的token
    export interface RegisterResData{
        error?: string,
        success?:string
    }
}
// 用户登录
export const register = (params: Register.RegisterReqForm) => {
    // 返回的数据格式可以和服务端约定
    return axios.post<Register.RegisterResData>('/register', params);
}
